using System;
using System.Collections.Generic;
using System.Text;
namespace MyDMS.BusinessLayer
{
	public class MailMessage: BusinessObjectBase
	{

		#region InnerClass
		public enum MailMessageFields
		{
			Message_Code,
			Message_Subject,
			Message_Body,
			Owner,
			Sent_Date,
			Office_Code,
			Is_Active,
			Creation_Date,
			Updation_Date
		}
		#endregion

		#region Data Members

			int _message_Code;
			string _message_Subject;
			string _message_Body;
			int _owner;
			DateTime _sent_Date;
			int _office_Code;
			bool? _is_Active;
			DateTime? _creation_Date;
			DateTime? _updation_Date;

		#endregion

		#region Properties

		public int  Message_Code
		{
			 get { return _message_Code; }
			 set
			 {
				 if (_message_Code != value)
				 {
					_message_Code = value;
					 PropertyHasChanged("Message_Code");
				 }
			 }
		}

		public string  Message_Subject
		{
			 get { return _message_Subject; }
			 set
			 {
				 if (_message_Subject != value)
				 {
					_message_Subject = value;
					 PropertyHasChanged("Message_Subject");
				 }
			 }
		}

		public string  Message_Body
		{
			 get { return _message_Body; }
			 set
			 {
				 if (_message_Body != value)
				 {
					_message_Body = value;
					 PropertyHasChanged("Message_Body");
				 }
			 }
		}

		public int  Owner
		{
			 get { return _owner; }
			 set
			 {
				 if (_owner != value)
				 {
					_owner = value;
					 PropertyHasChanged("Owner");
				 }
			 }
		}

		public DateTime  Sent_Date
		{
			 get { return _sent_Date; }
			 set
			 {
				 if (_sent_Date != value)
				 {
					_sent_Date = value;
					 PropertyHasChanged("Sent_Date");
				 }
			 }
		}

		public int  Office_Code
		{
			 get { return _office_Code; }
			 set
			 {
				 if (_office_Code != value)
				 {
					_office_Code = value;
					 PropertyHasChanged("Office_Code");
				 }
			 }
		}

		public bool?  Is_Active
		{
			 get { return _is_Active; }
			 set
			 {
				 if (_is_Active != value)
				 {
					_is_Active = value;
					 PropertyHasChanged("Is_Active");
				 }
			 }
		}

		public DateTime?  Creation_Date
		{
			 get { return _creation_Date; }
			 set
			 {
				 if (_creation_Date != value)
				 {
					_creation_Date = value;
					 PropertyHasChanged("Creation_Date");
				 }
			 }
		}

		public DateTime?  Updation_Date
		{
			 get { return _updation_Date; }
			 set
			 {
				 if (_updation_Date != value)
				 {
					_updation_Date = value;
					 PropertyHasChanged("Updation_Date");
				 }
			 }
		}


		#endregion

		#region Validation

		internal override void AddValidationRules()
		{
			ValidationRules.AddRules(new Validation.ValidateRuleNotNull("Message_Code", "Message_Code"));
			ValidationRules.AddRules(new Validation.ValidateRuleNotNull("Message_Subject", "Message_Subject"));
			ValidationRules.AddRules(new Validation.ValidateRuleStringMaxLength("Message_Subject", "Message_Subject",200));
			ValidationRules.AddRules(new Validation.ValidateRuleStringMaxLength("Message_Body", "Message_Body",2147483647));
			ValidationRules.AddRules(new Validation.ValidateRuleNotNull("Owner", "Owner"));
			ValidationRules.AddRules(new Validation.ValidateRuleNotNull("Sent_Date", "Sent_Date"));
			ValidationRules.AddRules(new Validation.ValidateRuleNotNull("Office_Code", "Office_Code"));
		}

		#endregion

	}
}
